<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
     

<h:head>
        <title>Central de Estagio Aluno</title>
        <link rel="StyleSheet" type="text/css" href="#{facesContext.externalContext.requestContextPath}/css/estilo.css" media="screen" />
        <link type="text/css" rel="stylesheet" href="#{facesContext.externalContext.requestContextPath}/css/tema/theme.css"/>
</h:head>
<h:body>
      <div align="center">
      		
		<h:form>
       
        	
        	<p:dataTable id="list" value="#{MBCurso.listarCurso}" var="curso" paginator="true" rows="8"
        		emptyMessage="Nenhum registro encontrado." paginatorPosition="bottom">
        		
        		<p:ajax event="rowToggle" />
     			<p:column style="width: 0.5%;">
        		<p:rowToggler />
        		</p:column>
        	<p:column style="width: 1%;" headerText="Cod" filterBy="#{curso.codCurso}" filterMatchMode="startsWith">
        		<h:outputText value="#{curso.codCurso}"/>
        	</p:column>
        	<p:column style="width: 5%;" headerText="Nome" filterBy="#{curso.nomeCurso}" filterMatchMode="startsWith">
        		<h:outputText value="#{curso.nomeCurso}"/>
        	</p:column>
        	<p:column style="width: 5%;" headerText="Duração" filterBy="#{curso.duracaoCurso}" filterMatchMode="startsWith">>
        		<h:outputText value="#{curso.duracaoCurso}"/>
        	</p:column>
        		<p:rowExpansion>
        			<p:column>
        			<p:commandButton value="Alterar" action="#{MBCurso.prepararUp()}" icon="ui-icon-pencil"/>
        			</p:column>
        			<p:column>
        			<p:commandButton value="Remover" action="#{MBCurso.delete()}" icon="ui-icon-trash" update="list"/>
        			</p:column>
        		</p:rowExpansion>
        	</p:dataTable>
			
        </h:form>  
      	  </div>	
</h:body>
</html>